<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-comment">-- | Typechecking class declarations</span><span>
</span><span id="line-13"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.TyCl.Class</span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassSigs"><span class="hs-identifier">tcClassSigs</span></a></span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassDecl2"><span class="hs-identifier">tcClassDecl2</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#findMethodBind"><span class="hs-identifier">findMethodBind</span></a></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instantiateMethod"><span class="hs-identifier">instantiateMethod</span></a></span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassMinimalDef"><span class="hs-identifier">tcClassMinimalDef</span></a></span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#HsSigFun"><span class="hs-identifier">HsSigFun</span></a></span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#mkHsSigFun"><span class="hs-identifier">mkHsSigFun</span></a></span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#badMethodErr"><span class="hs-identifier">badMethodErr</span></a></span><span>
</span><span id="line-22"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt1"><span class="hs-identifier">instDeclCtxt1</span></a></span><span>
</span><span id="line-23"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt2"><span class="hs-identifier">instDeclCtxt2</span></a></span><span>
</span><span id="line-24"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt3"><span class="hs-identifier">instDeclCtxt3</span></a></span><span>
</span><span id="line-25"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcATDefault"><span class="hs-identifier">tcATDefault</span></a></span><span>
</span><span id="line-26"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html"><span class="hs-identifier">GHC.Tc.Gen.Sig</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#idHsWrapper"><span class="hs-identifier">idHsWrapper</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Bind.html"><span class="hs-identifier">GHC.Tc.Gen.Bind</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html"><span class="hs-identifier">GHC.Tc.Utils.Unify</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html"><span class="hs-identifier">GHC.Tc.Utils.Instantiate</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html#tcSuperSkolTyVars"><span class="hs-identifier">tcSuperSkolTyVars</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.HsType.html"><span class="hs-identifier">GHC.Tc.Gen.HsType</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#piResultTys"><span class="hs-identifier">piResultTys</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Predicate.html"><span class="hs-identifier">GHC.Core.Predicate</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html"><span class="hs-identifier">GHC.Tc.Types.Origin</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html"><span class="hs-identifier">GHC.Driver.Phases</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Phases.html#HscSource"><span class="hs-identifier">HscSource</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Build.html"><span class="hs-identifier">GHC.Tc.TyCl.Build</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Build.html#TcMethInfo"><span class="hs-identifier">TcMethInfo</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Class.html"><span class="hs-identifier">GHC.Core.Class</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html#pprCoAxiom"><span class="hs-identifier">pprCoAxiom</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Instance.Family.html"><span class="hs-identifier">GHC.Tc.Instance.Family</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html"><span class="hs-identifier">GHC.Core.FamInstEnv</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.BooleanFormula.html"><span class="hs-identifier">GHC.Data.BooleanFormula</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">{-
Dictionary handling
~~~~~~~~~~~~~~~~~~~
Every class implicitly declares a new data type, corresponding to dictionaries
of that class. So, for example:

        class (D a) =&gt; C a where
          op1 :: a -&gt; a
          op2 :: forall b. Ord b =&gt; a -&gt; b -&gt; b

would implicitly declare

        data CDict a = CDict (D a)
                             (a -&gt; a)
                             (forall b. Ord b =&gt; a -&gt; b -&gt; b)

(We could use a record decl, but that means changing more of the existing apparatus.
One step at a time!)

For classes with just one superclass+method, we use a newtype decl instead:

        class C a where
          op :: forallb. a -&gt; b -&gt; b

generates

        newtype CDict a = CDict (forall b. a -&gt; b -&gt; b)

Now DictTy in Type is just a form of type synomym:
        DictTy c t = TyConTy CDict `AppTy` t

Death to &quot;ExpandingDicts&quot;.


************************************************************************
*                                                                      *
                Type-checking the class op signatures
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#illegalHsigDefaultMethod"><span class="hs-identifier hs-type">illegalHsigDefaultMethod</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-116"></span><span id="illegalHsigDefaultMethod"><span class="annot"><span class="annottext">illegalHsigDefaultMethod :: Name -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#illegalHsigDefaultMethod"><span class="hs-identifier hs-var hs-var">illegalHsigDefaultMethod</span></a></span></span><span> </span><span id="local-6989586621681164623"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164623"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-117"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Illegal default method(s) in class definition of&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164623"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in hsig file&quot;</span></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassSigs"><span class="hs-identifier hs-type">tcClassSigs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>                </span><span class="hs-comment">-- Name of the class</span><span>
</span><span id="line-120"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-121"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-122"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.TyCl.Build.html#TcMethInfo"><span class="hs-identifier hs-type">TcMethInfo</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- Exactly one for each method</span><span>
</span><span id="line-123"></span><span id="tcClassSigs"><span class="annot"><span class="annottext">tcClassSigs :: Name
-&gt; [LSig (GhcPass 'Renamed)]
-&gt; LHsBinds (GhcPass 'Renamed)
-&gt; TcM [TcMethInfo]
</span><a href="GHC.Tc.TyCl.Class.html#tcClassSigs"><span class="hs-identifier hs-var hs-var">tcClassSigs</span></a></span></span><span> </span><span id="local-6989586621681164618"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span id="local-6989586621681164617"><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164617"><span class="hs-identifier hs-var">sigs</span></a></span></span><span> </span><span id="local-6989586621681164616"><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164616"><span class="hs-identifier hs-var">def_methods</span></a></span></span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcClassSigs 1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164614"><span class="annot"><span class="annottext">[(Name, (SrcSpan, Type))]
</span><a href="#local-6989586621681164614"><span class="hs-identifier hs-var">gen_dm_prs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located ([Located Name], LHsSigType (GhcPass 'Renamed))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))])
-&gt; [Located ([Located Name], LHsSigType (GhcPass 'Renamed))]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m [b]) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#concatMapM"><span class="hs-identifier hs-var">concatMapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(([Located Name], LHsSigType (GhcPass 'Renamed))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))])
-&gt; Located ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))]
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM b
</span><a href="GHC.Tc.Utils.Monad.html#addLocM"><span class="hs-identifier hs-var">addLocM</span></a></span><span> </span><span class="annot"><span class="annottext">([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))]
</span><a href="#local-6989586621681164611"><span class="hs-identifier hs-var">tc_gen_sig</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located ([Located Name], LHsSigType (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164610"><span class="hs-identifier hs-var">gen_sigs</span></a></span><span>
</span><span id="line-127"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681164609"><span class="hs-identifier hs-type">gen_dm_env</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>             </span><span id="local-6989586621681164609"><span class="annot"><span class="annottext">gen_dm_env :: NameEnv (SrcSpan, Type)
</span><a href="#local-6989586621681164609"><span class="hs-identifier hs-var hs-var">gen_dm_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, (SrcSpan, Type))] -&gt; NameEnv (SrcSpan, Type)
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, (SrcSpan, Type))]
</span><a href="#local-6989586621681164614"><span class="hs-identifier hs-var">gen_dm_prs</span></a></span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164607"><span class="annot"><span class="annottext">[TcMethInfo]
</span><a href="#local-6989586621681164607"><span class="hs-identifier hs-var">op_info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located ([Located Name], LHsSigType (GhcPass 'Renamed))
 -&gt; TcM [TcMethInfo])
-&gt; [Located ([Located Name], LHsSigType (GhcPass 'Renamed))]
-&gt; TcM [TcMethInfo]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m [b]) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#concatMapM"><span class="hs-identifier hs-var">concatMapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(([Located Name], LHsSigType (GhcPass 'Renamed))
 -&gt; TcM [TcMethInfo])
-&gt; Located ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; TcM [TcMethInfo]
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM b
</span><a href="GHC.Tc.Utils.Monad.html#addLocM"><span class="hs-identifier hs-var">addLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameEnv (SrcSpan, Type)
-&gt; ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; TcM [TcMethInfo]
</span><a href="#local-6989586621681164606"><span class="hs-identifier hs-var">tc_sig</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (SrcSpan, Type)
</span><a href="#local-6989586621681164609"><span class="hs-identifier hs-var">gen_dm_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located ([Located Name], LHsSigType (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164605"><span class="hs-identifier hs-var">vanilla_sigs</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681164604"><span class="annot"><span class="annottext">op_names :: NameSet
</span><a href="#local-6989586621681164604"><span class="hs-identifier hs-var hs-var">op_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164602"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164602"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164602"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe (DefMethSpec (SrcSpan, Type))
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcMethInfo]
</span><a href="#local-6989586621681164607"><span class="hs-identifier hs-var">op_info</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-133"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[IOEnv (Env TcGblEnv TcLclEnv) Any] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, Monad m) =&gt;
t (m a) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#sequence_"><span class="hs-identifier hs-var">sequence_</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) Any
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; Name -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#badMethodErr"><span class="hs-identifier hs-var">badMethodErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164599"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681164599"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164599"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681164598"><span class="hs-identifier hs-var">dm_bind_names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164599"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681164604"><span class="hs-identifier hs-var">op_names</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-135"></span><span>                   </span><span class="hs-comment">-- Value binding for non class-method (ie no TypeSig)</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164595"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681164595"><span class="hs-identifier hs-var">tcg_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-138"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; HscSource
</span><a href="GHC.Tc.Types.html#tcg_src"><span class="hs-identifier hs-var hs-var">tcg_src</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681164595"><span class="hs-identifier hs-var">tcg_env</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span>
</span><span id="line-139"></span><span>            </span><span class="hs-keyword">then</span><span>
</span><span id="line-140"></span><span>               </span><span class="hs-comment">-- Error if we have value bindings</span><span>
</span><span id="line-141"></span><span>               </span><span class="hs-comment">-- (Generic signatures without value bindings indicate</span><span>
</span><span id="line-142"></span><span>               </span><span class="hs-comment">-- that a default of this form is expected to be</span><span>
</span><span id="line-143"></span><span>               </span><span class="hs-comment">-- provided.)</span><span>
</span><span id="line-144"></span><span>               </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed) -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164616"><span class="hs-identifier hs-var">def_methods</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-145"></span><span>                </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#illegalHsigDefaultMethod"><span class="hs-identifier hs-var">illegalHsigDefaultMethod</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>            </span><span class="hs-keyword">else</span><span>
</span><span id="line-147"></span><span>               </span><span class="hs-comment">-- Error for each generic signature without value binding</span><span>
</span><span id="line-148"></span><span>               </span><span class="annot"><span class="annottext">[IOEnv (Env TcGblEnv TcLclEnv) Any] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, Monad m) =&gt;
t (m a) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#sequence_"><span class="hs-identifier hs-var">sequence_</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) Any
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; Name -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#badGenericMethod"><span class="hs-identifier hs-var">badGenericMethod</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164588"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164588"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164588"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">(SrcSpan, Type)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Name, (SrcSpan, Type))]
</span><a href="#local-6989586621681164614"><span class="hs-identifier hs-var">gen_dm_prs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164588"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681164598"><span class="hs-identifier hs-var">dm_bind_names</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcClassSigs 2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcMethInfo] -&gt; TcM [TcMethInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[TcMethInfo]
</span><a href="#local-6989586621681164607"><span class="hs-identifier hs-var">op_info</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-154"></span><span>    </span><span id="local-6989586621681164605"><span class="annot"><span class="annottext">vanilla_sigs :: [Located ([Located Name], LHsSigType (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164605"><span class="hs-identifier hs-var hs-var">vanilla_sigs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan
-&gt; ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; Located ([Located Name], LHsSigType (GhcPass 'Renamed))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164585"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164584"><span class="hs-identifier hs-var">nm</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164583"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681164585"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164585"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span id="local-6989586621681164584"><span class="annot"><span class="annottext">[Located (IdP (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164584"><span class="hs-identifier hs-var">nm</span></a></span></span><span> </span><span id="local-6989586621681164583"><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164583"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164617"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-155"></span><span>    </span><span id="local-6989586621681164610"><span class="annot"><span class="annottext">gen_sigs :: [Located ([Located Name], LHsSigType (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164610"><span class="hs-identifier hs-var hs-var">gen_sigs</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan
-&gt; ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; Located ([Located Name], LHsSigType (GhcPass 'Renamed))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164581"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164580"><span class="hs-identifier hs-var">nm</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164579"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681164581"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164581"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span id="local-6989586621681164580"><span class="annot"><span class="annottext">[Located (IdP (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164580"><span class="hs-identifier hs-var">nm</span></a></span></span><span> </span><span id="local-6989586621681164579"><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164579"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164617"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-156"></span><span>    </span><span class="annot"><a href="#local-6989586621681164598"><span class="hs-identifier hs-type">dm_bind_names</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- These ones have a value binding in the class decl</span><span>
</span><span id="line-157"></span><span>    </span><span id="local-6989586621681164598"><span class="annot"><span class="annottext">dm_bind_names :: [Name]
</span><a href="#local-6989586621681164598"><span class="hs-identifier hs-var hs-var">dm_bind_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681164578"><span class="hs-identifier hs-var">op</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681164578"><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681164578"><span class="hs-identifier hs-var">op</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
-&gt; [GenLocated
      SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164616"><span class="hs-identifier hs-var">def_methods</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621681164574"><span class="annot"><span class="annottext">skol_info :: SkolemInfo
</span><a href="#local-6989586621681164574"><span class="hs-identifier hs-var hs-var">skol_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour -&gt; Name -&gt; SkolemInfo
</span><a href="GHC.Tc.Types.Origin.html#TyConSkol"><span class="hs-identifier hs-var">TyConSkol</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164618"><span class="hs-identifier hs-var">clas</span></a></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>    </span><span class="annot"><a href="#local-6989586621681164606"><span class="hs-identifier hs-type">tc_sig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigType"><span class="hs-identifier hs-type">LHsSigType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.TyCl.Build.html#TcMethInfo"><span class="hs-identifier hs-type">TcMethInfo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-163"></span><span>    </span><span id="local-6989586621681164606"><span class="annot"><span class="annottext">tc_sig :: NameEnv (SrcSpan, Type)
-&gt; ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; TcM [TcMethInfo]
</span><a href="#local-6989586621681164606"><span class="hs-identifier hs-var hs-var">tc_sig</span></a></span></span><span> </span><span id="local-6989586621681164571"><span class="annot"><span class="annottext">NameEnv (SrcSpan, Type)
</span><a href="#local-6989586621681164571"><span class="hs-identifier hs-var">gen_dm_env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164570"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164570"><span class="hs-identifier hs-var">op_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164569"><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164569"><span class="hs-identifier hs-var">op_hs_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ClsSig 1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164570"><span class="hs-identifier hs-var">op_names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164568"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164568"><span class="hs-identifier hs-var">op_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SkolemInfo
-&gt; [Located Name] -&gt; LHsSigType (GhcPass 'Renamed) -&gt; TcM Type
</span><a href="GHC.Tc.Gen.HsType.html#tcClassSigType"><span class="hs-identifier hs-var">tcClassSigType</span></a></span><span> </span><span class="annot"><span class="annottext">SkolemInfo
</span><a href="#local-6989586621681164574"><span class="hs-identifier hs-var">skol_info</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164570"><span class="hs-identifier hs-var">op_names</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164569"><span class="hs-identifier hs-var">op_hs_ty</span></a></span><span>
</span><span id="line-166"></span><span>                   </span><span class="hs-comment">-- Class tyvars already in scope</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ClsSig 2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164570"><span class="hs-identifier hs-var">op_names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcMethInfo] -&gt; TcM [TcMethInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164566"><span class="hs-identifier hs-var">op_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164568"><span class="hs-identifier hs-var">op_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe (DefMethSpec (SrcSpan, Type))
</span><a href="#local-6989586621681164565"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164566"><span class="hs-identifier hs-var">op_name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681164566"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164566"><span class="hs-identifier hs-var">op_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164570"><span class="hs-identifier hs-var">op_names</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-170"></span><span>           </span><span class="hs-keyword">where</span><span>
</span><span id="line-171"></span><span>             </span><span id="local-6989586621681164565"><span class="annot"><span class="annottext">f :: Name -&gt; Maybe (DefMethSpec (SrcSpan, Type))
</span><a href="#local-6989586621681164565"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681164564"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164564"><span class="hs-identifier hs-var">nm</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681164563"><span class="annot"><span class="annottext">(SrcSpan, Type)
</span><a href="#local-6989586621681164563"><span class="hs-identifier hs-var">lty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameEnv (SrcSpan, Type) -&gt; Name -&gt; Maybe (SrcSpan, Type)
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (SrcSpan, Type)
</span><a href="#local-6989586621681164571"><span class="hs-identifier hs-var">gen_dm_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164564"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefMethSpec (SrcSpan, Type) -&gt; Maybe (DefMethSpec (SrcSpan, Type))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SrcSpan, Type) -&gt; DefMethSpec (SrcSpan, Type)
forall ty. ty -&gt; DefMethSpec ty
</span><a href="GHC.Types.Basic.html#GenericDM"><span class="hs-identifier hs-var">GenericDM</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan, Type)
</span><a href="#local-6989586621681164563"><span class="hs-identifier hs-var">lty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-172"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164564"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681164598"><span class="hs-identifier hs-var">dm_bind_names</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefMethSpec (SrcSpan, Type) -&gt; Maybe (DefMethSpec (SrcSpan, Type))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DefMethSpec (SrcSpan, Type)
forall ty. DefMethSpec ty
</span><a href="GHC.Types.Basic.html#VanillaDM"><span class="hs-identifier hs-var">VanillaDM</span></a></span><span>
</span><span id="line-173"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (DefMethSpec (SrcSpan, Type))
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span>    </span><span id="local-6989586621681164611"><span class="annot"><span class="annottext">tc_gen_sig :: ([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))]
</span><a href="#local-6989586621681164611"><span class="hs-identifier hs-var hs-var">tc_gen_sig</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164559"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164559"><span class="hs-identifier hs-var">op_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164558"><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164558"><span class="hs-identifier hs-var">gen_hs_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681164557"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164557"><span class="hs-identifier hs-var">gen_op_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SkolemInfo
-&gt; [Located Name] -&gt; LHsSigType (GhcPass 'Renamed) -&gt; TcM Type
</span><a href="GHC.Tc.Gen.HsType.html#tcClassSigType"><span class="hs-identifier hs-var">tcClassSigType</span></a></span><span> </span><span class="annot"><span class="annottext">SkolemInfo
</span><a href="#local-6989586621681164574"><span class="hs-identifier hs-var">skol_info</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164559"><span class="hs-identifier hs-var">op_names</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164558"><span class="hs-identifier hs-var">gen_hs_ty</span></a></span><span>
</span><span id="line-177"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[(Name, (SrcSpan, Type))]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, (SrcSpan, Type))]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164556"><span class="hs-identifier hs-var">op_name</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164555"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164557"><span class="hs-identifier hs-var">gen_op_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681164555"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164555"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681164556"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164556"><span class="hs-identifier hs-var">op_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681164559"><span class="hs-identifier hs-var">op_names</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Class Declarations
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassDecl2"><span class="hs-identifier hs-type">tcClassDecl2</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Decls.html#LTyClDecl"><span class="hs-identifier hs-type">LTyClDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>          </span><span class="hs-comment">-- The class declaration</span><span>
</span><span id="line-188"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span id="tcClassDecl2"><span class="annot"><span class="annottext">tcClassDecl2 :: LTyClDecl (GhcPass 'Renamed) -&gt; TcM (LHsBinds GhcTc)
</span><a href="GHC.Tc.TyCl.Class.html#tcClassDecl2"><span class="hs-identifier hs-var hs-var">tcClassDecl2</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#ClassDecl"><span class="hs-identifier hs-type">ClassDecl</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">tcdLName :: forall pass. TyClDecl pass -&gt; Located (IdP pass)
</span><a href="GHC.Hs.Decls.html#tcdLName"><span class="hs-identifier hs-var">tcdLName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681164552"><span class="annot"><span class="annottext">Located (IdP (GhcPass 'Renamed))
</span><a href="#local-6989586621681164552"><span class="hs-identifier hs-var">class_name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcdSigs :: forall pass. TyClDecl pass -&gt; [LSig pass]
</span><a href="GHC.Hs.Decls.html#tcdSigs"><span class="hs-identifier hs-var">tcdSigs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681164550"><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164550"><span class="hs-identifier hs-var">sigs</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-191"></span><span>                                </span><span class="annot"><span class="annottext">tcdMeths :: forall pass. TyClDecl pass -&gt; LHsBinds pass
</span><a href="GHC.Hs.Decls.html#tcdMeths"><span class="hs-identifier hs-var">tcdMeths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681164548"><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164548"><span class="hs-identifier hs-var">default_binds</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (LHsBinds GhcTc)
-&gt; TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc)
forall r. TcRn r -&gt; TcRn r -&gt; TcRn r
</span><a href="GHC.Tc.Utils.Monad.html#recoverM"><span class="hs-identifier hs-var">recoverM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
forall idL idR. LHsBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#emptyLHsBinds"><span class="hs-identifier hs-var">emptyLHsBinds</span></a></span><span class="hs-special">)</span><span>     </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc))
-&gt; TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-193"></span><span>    </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP (GhcPass 'Renamed))
</span><a href="#local-6989586621681164552"><span class="hs-identifier hs-var">class_name</span></a></span><span class="hs-special">)</span><span>      </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc))
-&gt; TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681164543"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164543"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; TcM Class
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocatedClass"><span class="hs-identifier hs-var">tcLookupLocatedClass</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP (GhcPass 'Renamed))
</span><a href="#local-6989586621681164552"><span class="hs-identifier hs-var">class_name</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>        </span><span class="hs-comment">-- We make a separate binding for each default method.</span><span>
</span><span id="line-197"></span><span>        </span><span class="hs-comment">-- At one time I used a single AbsBinds for all of them, thus</span><span>
</span><span id="line-198"></span><span>        </span><span class="hs-comment">-- AbsBind [d] [dm1, dm2, dm3] { dm1 = ...; dm2 = ...; dm3 = ... }</span><span>
</span><span id="line-199"></span><span>        </span><span class="hs-comment">-- But that desugars into</span><span>
</span><span id="line-200"></span><span>        </span><span class="hs-comment">--      ds = \d -&gt; (..., ..., ...)</span><span>
</span><span id="line-201"></span><span>        </span><span class="hs-comment">--      dm1 = \d -&gt; case ds d of (a,b,c) -&gt; a</span><span>
</span><span id="line-202"></span><span>        </span><span class="hs-comment">-- And since ds is big, it doesn't get inlined, so we don't get good</span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">-- default methods.  Better to make separate AbsBinds for each</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164541"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164541"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164540"><span class="annot"><span class="annottext">[ClassOpItem]
</span><a href="#local-6989586621681164540"><span class="hs-identifier hs-var">op_items</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; ([TcId], [Type], [TcId], [ClassOpItem])
</span><a href="GHC.Core.Class.html#classBigSig"><span class="hs-identifier hs-var">classBigSig</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164543"><span class="hs-identifier hs-var">clas</span></a></span><span>
</span><span id="line-205"></span><span>              </span><span id="local-6989586621681164538"><span class="annot"><span class="annottext">prag_fn :: TcPragEnv
</span><a href="#local-6989586621681164538"><span class="hs-identifier hs-var hs-var">prag_fn</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
-&gt; LHsBinds (GhcPass 'Renamed) -&gt; TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#mkPragEnv"><span class="hs-identifier hs-var">mkPragEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164550"><span class="hs-identifier hs-var">sigs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164548"><span class="hs-identifier hs-var">default_binds</span></a></span><span>
</span><span id="line-206"></span><span>              </span><span id="local-6989586621681164536"><span class="annot"><span class="annottext">sig_fn :: HsSigFun
</span><a href="#local-6989586621681164536"><span class="hs-identifier hs-var hs-var">sig_fn</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)] -&gt; HsSigFun
</span><a href="GHC.Tc.TyCl.Class.html#mkHsSigFun"><span class="hs-identifier hs-var">mkHsSigFun</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164550"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-207"></span><span>              </span><span id="local-6989586621681164535"><span class="annot"><span class="annottext">clas_tyvars :: [TcId]
</span><a href="#local-6989586621681164535"><span class="hs-identifier hs-var hs-var">clas_tyvars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TCvSubst, [TcId]) -&gt; [TcId]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcId] -&gt; (TCvSubst, [TcId])
</span><a href="GHC.Tc.Utils.Instantiate.html#tcSuperSkolTyVars"><span class="hs-identifier hs-var">tcSuperSkolTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164541"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>              </span><span id="local-6989586621681164534"><span class="annot"><span class="annottext">pred :: Type
</span><a href="#local-6989586621681164534"><span class="hs-identifier hs-var hs-var">pred</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164543"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcId] -&gt; [Type]
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTys"><span class="hs-identifier hs-var">mkTyVarTys</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164535"><span class="hs-identifier hs-var">clas_tyvars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164531"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164531"><span class="hs-identifier hs-var">this_dict</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcRnIf TcGblEnv TcLclEnv TcId
forall gbl lcl. Type -&gt; TcRnIf gbl lcl TcId
</span><a href="GHC.Tc.Utils.TcMType.html#newEvVar"><span class="hs-identifier hs-var">newEvVar</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164534"><span class="hs-identifier hs-var">pred</span></a></span><span>
</span><span id="line-210"></span><span>
</span><span id="line-211"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681164529"><span class="annot"><span class="annottext">tc_item :: ClassOpItem -&gt; TcM (LHsBinds GhcTc)
</span><a href="#local-6989586621681164529"><span class="hs-identifier hs-var hs-var">tc_item</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class
-&gt; [TcId]
-&gt; TcId
-&gt; LHsBinds (GhcPass 'Renamed)
-&gt; HsSigFun
-&gt; TcPragEnv
-&gt; ClassOpItem
-&gt; TcM (LHsBinds GhcTc)
</span><a href="GHC.Tc.TyCl.Class.html#tcDefMeth"><span class="hs-identifier hs-var">tcDefMeth</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164543"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164535"><span class="hs-identifier hs-var">clas_tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164531"><span class="hs-identifier hs-var">this_dict</span></a></span><span>
</span><span id="line-212"></span><span>                                  </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164548"><span class="hs-identifier hs-var">default_binds</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigFun
</span><a href="#local-6989586621681164536"><span class="hs-identifier hs-var">sig_fn</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164538"><span class="hs-identifier hs-var">prag_fn</span></a></span><span>
</span><span id="line-213"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164527"><span class="annot"><span class="annottext">[LHsBinds GhcTc]
</span><a href="#local-6989586621681164527"><span class="hs-identifier hs-var">dm_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; TcM [LHsBinds GhcTc] -&gt; TcM [LHsBinds GhcTc]
forall r. [TcId] -&gt; TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Env.html#tcExtendTyVarEnv"><span class="hs-identifier hs-var">tcExtendTyVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164535"><span class="hs-identifier hs-var">clas_tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM [LHsBinds GhcTc] -&gt; TcM [LHsBinds GhcTc])
-&gt; TcM [LHsBinds GhcTc] -&gt; TcM [LHsBinds GhcTc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-214"></span><span>                      </span><span class="annot"><span class="annottext">(ClassOpItem -&gt; TcM (LHsBinds GhcTc))
-&gt; [ClassOpItem] -&gt; TcM [LHsBinds GhcTc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">ClassOpItem -&gt; TcM (LHsBinds GhcTc)
</span><a href="#local-6989586621681164529"><span class="hs-identifier hs-var">tc_item</span></a></span><span> </span><span class="annot"><span class="annottext">[ClassOpItem]
</span><a href="#local-6989586621681164540"><span class="hs-identifier hs-var">op_items</span></a></span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsBinds GhcTc] -&gt; LHsBinds GhcTc
forall a. [Bag a] -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionManyBags"><span class="hs-identifier hs-var">unionManyBags</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsBinds GhcTc]
</span><a href="#local-6989586621681164527"><span class="hs-identifier hs-var">dm_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassDecl2"><span class="hs-identifier hs-var">tcClassDecl2</span></a></span><span> </span><span id="local-6989586621681164523"><span class="annot"><span class="annottext">LTyClDecl (GhcPass 'Renamed)
</span><a href="#local-6989586621681164523"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (LHsBinds GhcTc)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcClassDecl2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LTyClDecl (GhcPass 'Renamed) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LTyClDecl (GhcPass 'Renamed)
</span><a href="#local-6989586621681164523"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcDefMeth"><span class="hs-identifier hs-type">tcDefMeth</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-221"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#HsSigFun"><span class="hs-identifier hs-type">HsSigFun</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassOpItem"><span class="hs-identifier hs-type">ClassOpItem</span></a></span><span>
</span><span id="line-222"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span class="hs-comment">-- Generate code for default methods</span><span>
</span><span id="line-224"></span><span class="hs-comment">-- This is incompatible with Hugs, which expects a polymorphic</span><span>
</span><span id="line-225"></span><span class="hs-comment">-- default method for every class op, regardless of whether or not</span><span>
</span><span id="line-226"></span><span class="hs-comment">-- the programmer supplied an explicit default decl for the class.</span><span>
</span><span id="line-227"></span><span class="hs-comment">-- (If necessary we can fix that, but we don't have a convenient Id to hand.)</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span id="tcDefMeth"><span class="annot"><span class="annottext">tcDefMeth :: Class
-&gt; [TcId]
-&gt; TcId
-&gt; LHsBinds (GhcPass 'Renamed)
-&gt; HsSigFun
-&gt; TcPragEnv
-&gt; ClassOpItem
-&gt; TcM (LHsBinds GhcTc)
</span><a href="GHC.Tc.TyCl.Class.html#tcDefMeth"><span class="hs-identifier hs-var hs-var">tcDefMeth</span></a></span></span><span> </span><span class="annot"><span class="annottext">Class
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TcId
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsSigFun
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681164519"><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164519"><span class="hs-identifier hs-var">prag_fn</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164518"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164518"><span class="hs-identifier hs-var">sel_id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe (Name, DefMethSpec Type)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- No default method</span><span>
</span><span id="line-231"></span><span>         </span><span class="annot"><span class="annottext">(LSig (GhcPass 'Renamed) -&gt; TcRn ())
-&gt; [LSig (GhcPass 'Renamed)] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Sig (GhcPass 'Renamed) -&gt; TcRn ())
-&gt; LSig (GhcPass 'Renamed) -&gt; TcRn ()
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM b
</span><a href="GHC.Tc.Utils.Monad.html#addLocM"><span class="hs-identifier hs-var">addLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; Sig (GhcPass 'Renamed) -&gt; TcRn ()
</span><a href="GHC.Tc.TyCl.Class.html#badDmPrag"><span class="hs-identifier hs-var">badDmPrag</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164518"><span class="hs-identifier hs-var">sel_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcPragEnv -&gt; Name -&gt; [LSig (GhcPass 'Renamed)]
</span><a href="GHC.Tc.Gen.Sig.html#lookupPragEnv"><span class="hs-identifier hs-var">lookupPragEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164519"><span class="hs-identifier hs-var">prag_fn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164518"><span class="hs-identifier hs-var">sel_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcDefMeth"><span class="hs-identifier hs-var">tcDefMeth</span></a></span><span> </span><span id="local-6989586621681164512"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164512"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span id="local-6989586621681164511"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164511"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span> </span><span id="local-6989586621681164510"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164510"><span class="hs-identifier hs-var">this_dict</span></a></span></span><span> </span><span id="local-6989586621681164509"><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164509"><span class="hs-identifier hs-var">binds_in</span></a></span></span><span> </span><span id="local-6989586621681164508"><span class="annot"><span class="annottext">HsSigFun
</span><a href="#local-6989586621681164508"><span class="hs-identifier hs-var">hs_sig_fn</span></a></span></span><span> </span><span id="local-6989586621681164507"><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164507"><span class="hs-identifier hs-var">prag_fn</span></a></span></span><span>
</span><span id="line-236"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681164506"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164506"><span class="hs-identifier hs-var">sel_id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164505"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164505"><span class="hs-identifier hs-var">dm_name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164504"><span class="annot"><span class="annottext">DefMethSpec Type
</span><a href="#local-6989586621681164504"><span class="hs-identifier hs-var">dm_spec</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681164503"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164503"><span class="hs-identifier hs-var">bind_loc</span></a></span></span><span> </span><span id="local-6989586621681164502"><span class="annot"><span class="annottext">HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)
</span><a href="#local-6989586621681164502"><span class="hs-identifier hs-var">dm_bind</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164501"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164501"><span class="hs-identifier hs-var">bndr_loc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164500"><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164500"><span class="hs-identifier hs-var">prags</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; LHsBinds (GhcPass 'Renamed)
-&gt; TcPragEnv
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
</span><a href="GHC.Tc.TyCl.Class.html#findMethodBind"><span class="hs-identifier hs-var">findMethodBind</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var">sel_name</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164509"><span class="hs-identifier hs-var">binds_in</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164507"><span class="hs-identifier hs-var">prag_fn</span></a></span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- First look up the default method; it should be there!</span><span>
</span><span id="line-239"></span><span>         </span><span class="hs-comment">-- It can be the ordinary default method</span><span>
</span><span id="line-240"></span><span>         </span><span class="hs-comment">-- or the generic-default method.  E.g of the latter</span><span>
</span><span id="line-241"></span><span>         </span><span class="hs-comment">--      class C a where</span><span>
</span><span id="line-242"></span><span>         </span><span class="hs-comment">--        op :: a -&gt; a -&gt; Bool</span><span>
</span><span id="line-243"></span><span>         </span><span class="hs-comment">--        default op :: Eq a =&gt; a -&gt; a -&gt; Bool</span><span>
</span><span id="line-244"></span><span>         </span><span class="hs-comment">--        op x y = x==y</span><span>
</span><span id="line-245"></span><span>         </span><span class="hs-comment">-- The default method we generate is</span><span>
</span><span id="line-246"></span><span>         </span><span class="hs-comment">--    $gm :: (C a, Eq a) =&gt; a -&gt; a -&gt; Bool</span><span>
</span><span id="line-247"></span><span>         </span><span class="hs-comment">--    $gm x y = x==y</span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span>         </span><span id="local-6989586621681164498"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164498"><span class="hs-identifier hs-var">global_dm_id</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcRnIf TcGblEnv TcLclEnv TcId
</span><a href="GHC.Tc.Utils.Env.html#tcLookupId"><span class="hs-identifier hs-var">tcLookupId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164505"><span class="hs-identifier hs-var">dm_name</span></a></span><span>
</span><span id="line-250"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164496"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164496"><span class="hs-identifier hs-var">global_dm_id</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; [LSig (GhcPass 'Renamed)] -&gt; TcRnIf TcGblEnv TcLclEnv TcId
</span><a href="GHC.Tc.Gen.Sig.html#addInlinePrags"><span class="hs-identifier hs-var">addInlinePrags</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164498"><span class="hs-identifier hs-var">global_dm_id</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164500"><span class="hs-identifier hs-var">prags</span></a></span><span>
</span><span id="line-251"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164494"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164494"><span class="hs-identifier hs-var">local_dm_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SrcSpan -&gt; TcM Name
</span><a href="GHC.Tc.Utils.Monad.html#newNameAt"><span class="hs-identifier hs-var">newNameAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var">sel_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164501"><span class="hs-identifier hs-var">bndr_loc</span></a></span><span>
</span><span id="line-252"></span><span>            </span><span class="hs-comment">-- Base the local_dm_name on the selector name, because</span><span>
</span><span id="line-253"></span><span>            </span><span class="hs-comment">-- type errors from tcInstanceMethodBody come from here</span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164491"><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681164491"><span class="hs-identifier hs-var">spec_prags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM [LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#discardConstraints"><span class="hs-identifier hs-var">discardConstraints</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM [LTcSpecPrag] -&gt; TcM [LTcSpecPrag])
-&gt; TcM [LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-256"></span><span>                       </span><span class="annot"><span class="annottext">TcId -&gt; [LSig (GhcPass 'Renamed)] -&gt; TcM [LTcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecPrags"><span class="hs-identifier hs-var">tcSpecPrags</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164496"><span class="hs-identifier hs-var">global_dm_id</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164500"><span class="hs-identifier hs-var">prags</span></a></span><span>
</span><span id="line-257"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnTc"><span class="hs-identifier hs-var">warnTc</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span>
</span><span id="line-258"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LTcSpecPrag] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681164491"><span class="hs-identifier hs-var">spec_prags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring SPECIALISE pragmas on default method&quot;</span></span><span>
</span><span id="line-260"></span><span>                 </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var">sel_name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681164485"><span class="annot"><span class="annottext">hs_ty :: LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164485"><span class="hs-identifier hs-var hs-var">hs_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsSigFun
</span><a href="#local-6989586621681164508"><span class="hs-identifier hs-var">hs_sig_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var">sel_name</span></a></span><span>
</span><span id="line-263"></span><span>                     </span><span class="annot"><span class="annottext">Maybe (LHsSigType (GhcPass 'Renamed))
-&gt; LHsSigType (GhcPass 'Renamed) -&gt; LHsSigType (GhcPass 'Renamed)
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; LHsSigType (GhcPass 'Renamed)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tc_dm&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var">sel_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span>             </span><span class="hs-comment">-- We need the HsType so that we can bring the right</span><span>
</span><span id="line-265"></span><span>             </span><span class="hs-comment">-- type variables into scope</span><span>
</span><span id="line-266"></span><span>             </span><span class="hs-comment">--</span><span>
</span><span id="line-267"></span><span>             </span><span class="hs-comment">-- Eg.   class C a where</span><span>
</span><span id="line-268"></span><span>             </span><span class="hs-comment">--          op :: forall b. Eq b =&gt; a -&gt; [b] -&gt; a</span><span>
</span><span id="line-269"></span><span>             </span><span class="hs-comment">--          gen_op :: a -&gt; a</span><span>
</span><span id="line-270"></span><span>             </span><span class="hs-comment">--          generic gen_op :: D a =&gt; a -&gt; a</span><span>
</span><span id="line-271"></span><span>             </span><span class="hs-comment">-- The &quot;local_dm_ty&quot; is precisely the type in the above</span><span>
</span><span id="line-272"></span><span>             </span><span class="hs-comment">-- type signatures, ie with no &quot;forall a. C a =&gt;&quot; prefix</span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>             </span><span id="local-6989586621681164483"><span class="annot"><span class="annottext">local_dm_ty :: Type
</span><a href="#local-6989586621681164483"><span class="hs-identifier hs-var hs-var">local_dm_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; TcId -&gt; [Type] -&gt; Type
</span><a href="GHC.Tc.TyCl.Class.html#instantiateMethod"><span class="hs-identifier hs-var">instantiateMethod</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164512"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164496"><span class="hs-identifier hs-var">global_dm_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcId] -&gt; [Type]
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTys"><span class="hs-identifier hs-var">mkTyVarTys</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164511"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span>             </span><span id="local-6989586621681164482"><span class="annot"><span class="annottext">lm_bind :: HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)
</span><a href="#local-6989586621681164482"><span class="hs-identifier hs-var hs-var">lm_bind</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)
</span><a href="#local-6989586621681164502"><span class="hs-identifier hs-var">dm_bind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: Located (IdP (GhcPass 'Renamed))
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164503"><span class="hs-identifier hs-var">bind_loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164494"><span class="hs-identifier hs-var">local_dm_name</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-277"></span><span>                             </span><span class="hs-comment">-- Substitute the local_meth_name for the binder</span><span>
</span><span id="line-278"></span><span>                             </span><span class="hs-comment">-- NB: the binding is always a FunBind</span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span>             </span><span id="local-6989586621681164481"><span class="annot"><span class="annottext">warn_redundant :: Bool
</span><a href="#local-6989586621681164481"><span class="hs-identifier hs-var hs-var">warn_redundant</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DefMethSpec Type
</span><a href="#local-6989586621681164504"><span class="hs-identifier hs-var">dm_spec</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-281"></span><span>                                </span><span class="annot"><a href="GHC.Types.Basic.html#GenericDM"><span class="hs-identifier hs-type">GenericDM</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-282"></span><span>                                </span><span class="annot"><span class="annottext">DefMethSpec Type
</span><a href="GHC.Types.Basic.html#VanillaDM"><span class="hs-identifier hs-var">VanillaDM</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-283"></span><span>                </span><span class="hs-comment">-- For GenericDM, warn if the user specifies a signature</span><span>
</span><span id="line-284"></span><span>                </span><span class="hs-comment">-- with redundant constraints; but not for VanillaDM, where</span><span>
</span><span id="line-285"></span><span>                </span><span class="hs-comment">-- the default method may well be 'error' or something</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span>             </span><span id="local-6989586621681164480"><span class="annot"><span class="annottext">ctxt :: UserTypeCtxt
</span><a href="#local-6989586621681164480"><span class="hs-identifier hs-var hs-var">ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#FunSigCtxt"><span class="hs-identifier hs-var">FunSigCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var">sel_name</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681164481"><span class="hs-identifier hs-var">warn_redundant</span></a></span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681164478"><span class="annot"><span class="annottext">local_dm_id :: TcId
</span><a href="#local-6989586621681164478"><span class="hs-identifier hs-var hs-var">local_dm_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Type -&gt; Type -&gt; TcId
Name -&gt; Type -&gt; Type -&gt; TcId
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164494"><span class="hs-identifier hs-var">local_dm_name</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164483"><span class="hs-identifier hs-var">local_dm_ty</span></a></span><span>
</span><span id="line-290"></span><span>             </span><span id="local-6989586621681164475"><span class="annot"><span class="annottext">local_dm_sig :: TcIdSigInfo
</span><a href="#local-6989586621681164475"><span class="hs-identifier hs-var hs-var">local_dm_sig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompleteSig :: TcId -&gt; UserTypeCtxt -&gt; SrcSpan -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Types.html#CompleteSig"><span class="hs-identifier hs-type">CompleteSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_bndr :: TcId
</span><a href="GHC.Tc.Types.html#sig_bndr"><span class="hs-identifier hs-var">sig_bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164478"><span class="hs-identifier hs-var">local_dm_id</span></a></span><span>
</span><span id="line-291"></span><span>                                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_ctxt :: UserTypeCtxt
</span><a href="GHC.Tc.Types.html#sig_ctxt"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681164480"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-292"></span><span>                                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_loc :: SrcSpan
</span><a href="GHC.Tc.Types.html#sig_loc"><span class="hs-identifier hs-var">sig_loc</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsType (GhcPass 'Renamed) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed) -&gt; LHsType (GhcPass 'Renamed)
forall (p :: Pass). LHsSigType (GhcPass p) -&gt; LHsType (GhcPass p)
</span><a href="GHC.Hs.Type.html#hsSigType"><span class="hs-identifier hs-var">hsSigType</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164485"><span class="hs-identifier hs-var">hs_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164469"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681164469"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164468"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681164468"><span class="hs-identifier hs-var">tc_bind</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-295"></span><span>               </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SkolemInfo
-&gt; [TcId]
-&gt; [TcId]
-&gt; TcM (LHsBinds GhcTc, [TcId])
-&gt; TcM (TcEvBinds, (LHsBinds GhcTc, [TcId]))
forall result.
SkolemInfo
-&gt; [TcId] -&gt; [TcId] -&gt; TcM result -&gt; TcM (TcEvBinds, result)
</span><a href="GHC.Tc.Utils.Unify.html#checkConstraints"><span class="hs-identifier hs-var">checkConstraints</span></a></span><span> </span><span class="annot"><span class="annottext">SkolemInfo
</span><a href="#local-6989586621681164466"><span class="hs-identifier hs-var">skol_info</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164511"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164510"><span class="hs-identifier hs-var">this_dict</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc, [TcId])
 -&gt; TcM (TcEvBinds, (LHsBinds GhcTc, [TcId])))
-&gt; TcM (LHsBinds GhcTc, [TcId])
-&gt; TcM (TcEvBinds, (LHsBinds GhcTc, [TcId]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-296"></span><span>                  </span><span class="annot"><span class="annottext">TcPragEnv
-&gt; TcIdSigInfo
-&gt; GenLocated
     SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
-&gt; TcM (LHsBinds GhcTc, [TcId])
</span><a href="GHC.Tc.Gen.Bind.html#tcPolyCheck"><span class="hs-identifier hs-var">tcPolyCheck</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164464"><span class="hs-identifier hs-var">no_prag_fn</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681164475"><span class="hs-identifier hs-var">local_dm_sig</span></a></span><span>
</span><span id="line-297"></span><span>                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)
-&gt; GenLocated
     SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164503"><span class="hs-identifier hs-var">bind_loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)
</span><a href="#local-6989586621681164482"><span class="hs-identifier hs-var">lm_bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681164463"><span class="annot"><span class="annottext">export :: ABExport GhcTc
</span><a href="#local-6989586621681164463"><span class="hs-keyword hs-var hs-var">export</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ABE :: forall p.
XABE p -&gt; IdP p -&gt; IdP p -&gt; HsWrapper -&gt; TcSpecPrags -&gt; ABExport p
</span><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_ext :: XABE GhcTc
</span><a href="#local-6989586621681164461"><span class="hs-identifier hs-var">abe_ext</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XABE GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-300"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_poly :: IdP GhcTc
</span><a href="#local-6989586621681164459"><span class="hs-identifier hs-var">abe_poly</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId
IdP GhcTc
</span><a href="#local-6989586621681164496"><span class="hs-identifier hs-var">global_dm_id</span></a></span><span>
</span><span id="line-301"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_mono :: IdP GhcTc
</span><a href="#local-6989586621681164458"><span class="hs-identifier hs-var">abe_mono</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId
IdP GhcTc
</span><a href="#local-6989586621681164478"><span class="hs-identifier hs-var">local_dm_id</span></a></span><span>
</span><span id="line-302"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_wrap :: HsWrapper
</span><a href="#local-6989586621681164457"><span class="hs-identifier hs-var">abe_wrap</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#idHsWrapper"><span class="hs-identifier hs-var">idHsWrapper</span></a></span><span>
</span><span id="line-303"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_prags :: TcSpecPrags
</span><a href="#local-6989586621681164456"><span class="hs-identifier hs-var">abe_prags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="GHC.Hs.Binds.html#IsDefaultMethod"><span class="hs-identifier hs-var">IsDefaultMethod</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-304"></span><span>             </span><span id="local-6989586621681164454"><span class="annot"><span class="annottext">full_bind :: HsBindLR GhcTc GhcTc
</span><a href="#local-6989586621681164454"><span class="hs-identifier hs-var hs-var">full_bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AbsBinds :: forall idL idR.
XAbsBinds idL idR
-&gt; [TcId]
-&gt; [TcId]
-&gt; [ABExport idL]
-&gt; [TcEvBinds]
-&gt; LHsBinds idL
-&gt; Bool
-&gt; HsBindLR idL idR
</span><a href="GHC.Hs.Binds.html#AbsBinds"><span class="hs-identifier hs-type">AbsBinds</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abs_ext :: XAbsBinds GhcTc GhcTc
</span><a href="#local-6989586621681164452"><span class="hs-identifier hs-var">abs_ext</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XAbsBinds GhcTc GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-305"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_tvs :: [TcId]
</span><a href="#local-6989586621681164451"><span class="hs-identifier hs-var">abs_tvs</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164511"><span class="hs-identifier hs-var">tyvars</span></a></span><span>
</span><span id="line-306"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_ev_vars :: [TcId]
</span><a href="#local-6989586621681164450"><span class="hs-identifier hs-var">abs_ev_vars</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164510"><span class="hs-identifier hs-var">this_dict</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-307"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_exports :: [ABExport GhcTc]
</span><a href="#local-6989586621681164449"><span class="hs-identifier hs-var">abs_exports</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ABExport GhcTc
</span><a href="#local-6989586621681164463"><span class="hs-keyword hs-var">export</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_ev_binds :: [TcEvBinds]
</span><a href="#local-6989586621681164448"><span class="hs-identifier hs-var">abs_ev_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681164469"><span class="hs-identifier hs-var">ev_binds</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-309"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_binds :: LHsBinds GhcTc
</span><a href="#local-6989586621681164447"><span class="hs-identifier hs-var">abs_binds</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681164468"><span class="hs-identifier hs-var">tc_bind</span></a></span><span>
</span><span id="line-310"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_sig :: Bool
</span><a href="#local-6989586621681164446"><span class="hs-identifier hs-var">abs_sig</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBindLR GhcTc GhcTc) -&gt; LHsBinds GhcTc
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; HsBindLR GhcTc GhcTc
-&gt; GenLocated SrcSpan (HsBindLR GhcTc GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164503"><span class="hs-identifier hs-var">bind_loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcTc GhcTc
</span><a href="#local-6989586621681164454"><span class="hs-identifier hs-var">full_bind</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-313"></span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (LHsBinds GhcTc)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcDefMeth&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164506"><span class="hs-identifier hs-var">sel_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-315"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-316"></span><span>    </span><span id="local-6989586621681164466"><span class="annot"><span class="annottext">skol_info :: SkolemInfo
</span><a href="#local-6989586621681164466"><span class="hs-identifier hs-var hs-var">skol_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour -&gt; Name -&gt; SkolemInfo
</span><a href="GHC.Tc.Types.Origin.html#TyConSkol"><span class="hs-identifier hs-var">TyConSkol</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Class -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164512"><span class="hs-identifier hs-var">clas</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span>    </span><span id="local-6989586621681164499"><span class="annot"><span class="annottext">sel_name :: Name
</span><a href="#local-6989586621681164499"><span class="hs-identifier hs-var hs-var">sel_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164506"><span class="hs-identifier hs-var">sel_id</span></a></span><span>
</span><span id="line-318"></span><span>    </span><span id="local-6989586621681164464"><span class="annot"><span class="annottext">no_prag_fn :: TcPragEnv
</span><a href="#local-6989586621681164464"><span class="hs-identifier hs-var hs-var">no_prag_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#emptyPragEnv"><span class="hs-identifier hs-var">emptyPragEnv</span></a></span><span>   </span><span class="hs-comment">-- No pragmas for local_meth_id;</span><span>
</span><span id="line-319"></span><span>                                </span><span class="hs-comment">-- they are all for meth_id</span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-322"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcClassMinimalDef"><span class="hs-identifier hs-type">tcClassMinimalDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.TyCl.Build.html#TcMethInfo"><span class="hs-identifier hs-type">TcMethInfo</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassMinimalDef"><span class="hs-identifier hs-type">ClassMinimalDef</span></a></span><span>
</span><span id="line-323"></span><span id="tcClassMinimalDef"><span class="annot"><span class="annottext">tcClassMinimalDef :: Name
-&gt; [LSig (GhcPass 'Renamed)] -&gt; [TcMethInfo] -&gt; TcM ClassMinimalDef
</span><a href="GHC.Tc.TyCl.Class.html#tcClassMinimalDef"><span class="hs-identifier hs-var hs-var">tcClassMinimalDef</span></a></span></span><span> </span><span id="local-6989586621681164442"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164442"><span class="hs-identifier hs-var">_clas</span></a></span></span><span> </span><span id="local-6989586621681164441"><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164441"><span class="hs-identifier hs-var">sigs</span></a></span></span><span> </span><span id="local-6989586621681164440"><span class="annot"><span class="annottext">[TcMethInfo]
</span><a href="#local-6989586621681164440"><span class="hs-identifier hs-var">op_info</span></a></span></span><span>
</span><span id="line-324"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)] -&gt; Maybe ClassMinimalDef
</span><a href="GHC.Tc.TyCl.Class.html#findMinimalDef"><span class="hs-identifier hs-var">findMinimalDef</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164441"><span class="hs-identifier hs-var">sigs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-325"></span><span>      </span><span class="annot"><span class="annottext">Maybe ClassMinimalDef
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; TcM ClassMinimalDef
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164438"><span class="hs-identifier hs-var">defMindef</span></a></span><span>
</span><span id="line-326"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681164437"><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164437"><span class="hs-identifier hs-var">mindef</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-327"></span><span>        </span><span class="hs-comment">-- Warn if the given mindef does not imply the default one</span><span>
</span><span id="line-328"></span><span>        </span><span class="hs-comment">-- That is, the given mindef should at least ensure that the</span><span>
</span><span id="line-329"></span><span>        </span><span class="hs-comment">-- class ops without default methods are required, since we</span><span>
</span><span id="line-330"></span><span>        </span><span class="hs-comment">-- have no way to fill them in otherwise</span><span>
</span><span id="line-331"></span><span>        </span><span id="local-6989586621681164436"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681164436"><span class="hs-identifier hs-var">tcg_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-332"></span><span>        </span><span class="hs-comment">-- However, only do this test when it's not an hsig file,</span><span>
</span><span id="line-333"></span><span>        </span><span class="hs-comment">-- since you can't write a default implementation.</span><span>
</span><span id="line-334"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; HscSource
</span><a href="GHC.Tc.Types.html#tcg_src"><span class="hs-identifier hs-var hs-var">tcg_src</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681164436"><span class="hs-identifier hs-var">tcg_env</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-335"></span><span>            </span><span class="annot"><span class="annottext">Maybe ClassMinimalDef -&gt; (ClassMinimalDef -&gt; TcRn ()) -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; Maybe a -&gt; (a -&gt; m ()) -&gt; m ()
</span><a href="GHC.Data.Maybe.html#whenIsJust"><span class="hs-identifier hs-var">whenIsJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; ClassMinimalDef -&gt; Maybe ClassMinimalDef
forall a.
Eq a =&gt;
(a -&gt; Bool) -&gt; BooleanFormula a -&gt; Maybe (BooleanFormula a)
</span><a href="GHC.Data.BooleanFormula.html#isUnsatisfied"><span class="hs-identifier hs-var">isUnsatisfied</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164437"><span class="hs-identifier hs-var">mindef</span></a></span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; Name -&gt; Bool
forall a. Eq a =&gt; BooleanFormula a -&gt; a -&gt; Bool
</span><a href="GHC.Data.BooleanFormula.html#impliesAtom"><span class="hs-operator hs-var">`impliesAtom`</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164438"><span class="hs-identifier hs-var">defMindef</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ClassMinimalDef -&gt; TcRn ()) -&gt; TcRn ())
-&gt; (ClassMinimalDef -&gt; TcRn ()) -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-336"></span><span>                       </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681164431"><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164431"><span class="hs-identifier hs-var">bf</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarnTc"><span class="hs-identifier hs-var">addWarnTc</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#warningMinimalDefIncomplete"><span class="hs-identifier hs-var">warningMinimalDefIncomplete</span></a></span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164431"><span class="hs-identifier hs-var">bf</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>        </span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; TcM ClassMinimalDef
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164437"><span class="hs-identifier hs-var">mindef</span></a></span><span>
</span><span id="line-338"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-339"></span><span>    </span><span class="hs-comment">-- By default require all methods without a default implementation</span><span>
</span><span id="line-340"></span><span>    </span><span class="annot"><a href="#local-6989586621681164438"><span class="hs-identifier hs-type">defMindef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassMinimalDef"><span class="hs-identifier hs-type">ClassMinimalDef</span></a></span><span>
</span><span id="line-341"></span><span>    </span><span id="local-6989586621681164438"><span class="annot"><span class="annottext">defMindef :: ClassMinimalDef
</span><a href="#local-6989586621681164438"><span class="hs-identifier hs-var hs-var">defMindef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LBooleanFormula Name] -&gt; ClassMinimalDef
forall a. Eq a =&gt; [LBooleanFormula a] -&gt; BooleanFormula a
</span><a href="GHC.Data.BooleanFormula.html#mkAnd"><span class="hs-identifier hs-var">mkAnd</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; LBooleanFormula Name
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; ClassMinimalDef
forall a. a -&gt; BooleanFormula a
</span><a href="GHC.Data.BooleanFormula.html#mkVar"><span class="hs-identifier hs-var">mkVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164425"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-342"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164425"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164425"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe (DefMethSpec (SrcSpan, Type))
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcMethInfo]
</span><a href="#local-6989586621681164440"><span class="hs-identifier hs-var">op_info</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instantiateMethod"><span class="hs-identifier hs-type">instantiateMethod</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>
</span><span id="line-345"></span><span class="hs-comment">-- Take a class operation, say</span><span>
</span><span id="line-346"></span><span class="hs-comment">--      op :: forall ab. C a =&gt; forall c. Ix c =&gt; (b,c) -&gt; a</span><span>
</span><span id="line-347"></span><span class="hs-comment">-- Instantiate it at [ty1,ty2]</span><span>
</span><span id="line-348"></span><span class="hs-comment">-- Return the &quot;local method type&quot;:</span><span>
</span><span id="line-349"></span><span class="hs-comment">--      forall c. Ix x =&gt; (ty2,c) -&gt; ty1</span><span>
</span><span id="line-350"></span><span id="instantiateMethod"><span class="annot"><span class="annottext">instantiateMethod :: Class -&gt; TcId -&gt; [Type] -&gt; Type
</span><a href="GHC.Tc.TyCl.Class.html#instantiateMethod"><span class="hs-identifier hs-var hs-var">instantiateMethod</span></a></span></span><span> </span><span id="local-6989586621681164423"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164423"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span id="local-6989586621681164422"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164422"><span class="hs-identifier hs-var">sel_id</span></a></span></span><span> </span><span id="local-6989586621681164421"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164421"><span class="hs-identifier hs-var">inst_tys</span></a></span></span><span>
</span><span id="line-351"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">ok_first_pred</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">local_meth_ty</span><span>
</span><span id="line-352"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-353"></span><span>    </span><span id="local-6989586621681164415"><span class="annot"><span class="annottext">rho_ty :: Type
</span><a href="#local-6989586621681164415"><span class="hs-identifier hs-var hs-var">rho_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [Type] -&gt; Type
Type -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.Type.html#piResultTys"><span class="hs-identifier hs-var">piResultTys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164422"><span class="hs-identifier hs-var">sel_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164421"><span class="hs-identifier hs-var">inst_tys</span></a></span><span>
</span><span id="line-354"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681164413"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164413"><span class="hs-identifier hs-var">first_pred</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164416"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164416"><span class="hs-identifier hs-var">local_meth_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe (Type, Type)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitPredFunTy_maybe"><span class="hs-identifier hs-var">tcSplitPredFunTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164415"><span class="hs-identifier hs-var">rho_ty</span></a></span><span>
</span><span id="line-355"></span><span>                </span><span class="annot"><span class="annottext">Maybe (Type, Type) -&gt; (Type, Type) -&gt; (Type, Type)
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (Type, Type)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcInstanceMethod&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164422"><span class="hs-identifier hs-var">sel_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span>
</span><span id="line-357"></span><span>    </span><span id="local-6989586621681164418"><span class="annot"><span class="annottext">ok_first_pred :: Bool
</span><a href="#local-6989586621681164418"><span class="hs-identifier hs-var hs-var">ok_first_pred</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe (Class, [Type])
</span><a href="GHC.Core.Predicate.html#getClassPredTys_maybe"><span class="hs-identifier hs-var">getClassPredTys_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164413"><span class="hs-identifier hs-var">first_pred</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-358"></span><span>                      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164410"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164410"><span class="hs-identifier hs-var">clas1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164409"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164409"><span class="hs-identifier hs-var">_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164423"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="annot"><span class="annottext">Class -&gt; Class -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164410"><span class="hs-identifier hs-var">clas1</span></a></span><span>
</span><span id="line-359"></span><span>                      </span><span class="annot"><span class="annottext">Maybe (Class, [Type])
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-360"></span><span>              </span><span class="hs-comment">-- The first predicate should be of form (C a b)</span><span>
</span><span id="line-361"></span><span>              </span><span class="hs-comment">-- where C is the class in question</span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="hs-comment">---------------------------</span><span>
</span><span id="line-365"></span><span class="hs-keyword">type</span><span> </span><span id="HsSigFun"><span class="annot"><a href="GHC.Tc.TyCl.Class.html#HsSigFun"><span class="hs-identifier hs-var">HsSigFun</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigType"><span class="hs-identifier hs-type">LHsSigType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#mkHsSigFun"><span class="hs-identifier hs-type">mkHsSigFun</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#HsSigFun"><span class="hs-identifier hs-type">HsSigFun</span></a></span><span>
</span><span id="line-368"></span><span id="mkHsSigFun"><span class="annot"><span class="annottext">mkHsSigFun :: [LSig (GhcPass 'Renamed)] -&gt; HsSigFun
</span><a href="GHC.Tc.TyCl.Class.html#mkHsSigFun"><span class="hs-identifier hs-var hs-var">mkHsSigFun</span></a></span></span><span> </span><span id="local-6989586621681164408"><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164408"><span class="hs-identifier hs-var">sigs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv (LHsSigType (GhcPass 'Renamed)) -&gt; HsSigFun
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (LHsSigType (GhcPass 'Renamed))
</span><a href="#local-6989586621681164407"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-369"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-370"></span><span>    </span><span id="local-6989586621681164407"><span class="annot"><span class="annottext">env :: NameEnv (LHsSigType (GhcPass 'Renamed))
</span><a href="#local-6989586621681164407"><span class="hs-identifier hs-var hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig (GhcPass 'Renamed)
 -&gt; Maybe ([Located Name], LHsSigType (GhcPass 'Renamed)))
-&gt; [LSig (GhcPass 'Renamed)]
-&gt; NameEnv (LHsSigType (GhcPass 'Renamed))
forall a.
(LSig (GhcPass 'Renamed) -&gt; Maybe ([Located Name], a))
-&gt; [LSig (GhcPass 'Renamed)] -&gt; NameEnv a
</span><a href="GHC.Hs.Utils.html#mkHsSigEnv"><span class="hs-identifier hs-var">mkHsSigEnv</span></a></span><span> </span><span class="annot"><span class="annottext">LSig (GhcPass 'Renamed)
-&gt; Maybe ([Located Name], LHsSigType (GhcPass 'Renamed))
</span><a href="#local-6989586621681164405"><span class="hs-identifier hs-var">get_classop_sig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164408"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-371"></span><span>
</span><span id="line-372"></span><span>    </span><span class="annot"><a href="#local-6989586621681164405"><span class="hs-identifier hs-type">get_classop_sig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigType"><span class="hs-identifier hs-type">LHsSigType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>    </span><span id="local-6989586621681164405"><span class="annot"><span class="annottext">get_classop_sig :: LSig (GhcPass 'Renamed)
-&gt; Maybe ([Located Name], LHsSigType (GhcPass 'Renamed))
</span><a href="#local-6989586621681164405"><span class="hs-identifier hs-var hs-var">get_classop_sig</span></a></span></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681164404"><span class="annot"><span class="annottext">[Located (IdP (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164404"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span id="local-6989586621681164403"><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164403"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Located Name], LHsSigType (GhcPass 'Renamed))
-&gt; Maybe ([Located Name], LHsSigType (GhcPass 'Renamed))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP (GhcPass 'Renamed))]
</span><a href="#local-6989586621681164404"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164403"><span class="hs-identifier hs-var">hs_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-374"></span><span>    </span><span class="annot"><a href="#local-6989586621681164405"><span class="hs-identifier hs-var">get_classop_sig</span></a></span><span>  </span><span class="annot"><span class="annottext">LSig (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span>                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([Located Name], LHsSigType (GhcPass 'Renamed))
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="hs-comment">---------------------------</span><span>
</span><span id="line-377"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#findMethodBind"><span class="hs-identifier hs-type">findMethodBind</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>                 </span><span class="hs-comment">-- Selector</span><span>
</span><span id="line-378"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>       </span><span class="hs-comment">-- A group of bindings</span><span>
</span><span id="line-379"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span>
</span><span id="line-380"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBind"><span class="hs-identifier hs-type">LHsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-381"></span><span>                </span><span class="hs-comment">-- Returns the binding, the binding</span><span>
</span><span id="line-382"></span><span>                </span><span class="hs-comment">-- site of the method binder, and any inline or</span><span>
</span><span id="line-383"></span><span>                </span><span class="hs-comment">-- specialisation pragmas</span><span>
</span><span id="line-384"></span><span id="findMethodBind"><span class="annot"><span class="annottext">findMethodBind :: Name
-&gt; LHsBinds (GhcPass 'Renamed)
-&gt; TcPragEnv
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
</span><a href="GHC.Tc.TyCl.Class.html#findMethodBind"><span class="hs-identifier hs-var hs-var">findMethodBind</span></a></span></span><span> </span><span id="local-6989586621681164401"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164401"><span class="hs-identifier hs-var">sel_name</span></a></span></span><span> </span><span id="local-6989586621681164400"><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164400"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span id="local-6989586621681164399"><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164399"><span class="hs-identifier hs-var">prag_fn</span></a></span></span><span>
</span><span id="line-385"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe
   (GenLocated
      SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
    SrcSpan, [LSig (GhcPass 'Renamed)])
 -&gt; Maybe
      (GenLocated
         SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
       SrcSpan, [LSig (GhcPass 'Renamed)])
 -&gt; Maybe
      (GenLocated
         SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
       SrcSpan, [LSig (GhcPass 'Renamed)]))
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
-&gt; Bag
     (Maybe
        (GenLocated
           SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
         SrcSpan, [LSig (GhcPass 'Renamed)]))
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe
  (GenLocated
     SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
   SrcSpan, [LSig (GhcPass 'Renamed)])
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-identifier hs-var">mplus</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe
  (GenLocated
     SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
   SrcSpan, [LSig (GhcPass 'Renamed)])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GenLocated
   SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
 -&gt; Maybe
      (GenLocated
         SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
       SrcSpan, [LSig (GhcPass 'Renamed)]))
-&gt; LHsBinds (GhcPass 'Renamed)
-&gt; Bag
     (Maybe
        (GenLocated
           SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
         SrcSpan, [LSig (GhcPass 'Renamed)]))
forall a b. (a -&gt; b) -&gt; Bag a -&gt; Bag b
</span><a href="GHC.Data.Bag.html#mapBag"><span class="hs-identifier hs-var">mapBag</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
</span><a href="#local-6989586621681164395"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds (GhcPass 'Renamed)
</span><a href="#local-6989586621681164400"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-386"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-387"></span><span>    </span><span id="local-6989586621681164394"><span class="annot"><span class="annottext">prags :: [LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164394"><span class="hs-identifier hs-var hs-var">prags</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcPragEnv -&gt; Name -&gt; [LSig (GhcPass 'Renamed)]
</span><a href="GHC.Tc.Gen.Sig.html#lookupPragEnv"><span class="hs-identifier hs-var">lookupPragEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681164399"><span class="hs-identifier hs-var">prag_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164401"><span class="hs-identifier hs-var">sel_name</span></a></span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span>    </span><span id="local-6989586621681164395"><span class="annot"><span class="annottext">f :: GenLocated SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
</span><a href="#local-6989586621681164395"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681164393"><span class="annot"><span class="annottext">bind :: GenLocated SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
</span><a href="#local-6989586621681164393"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681164392"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164392"><span class="hs-identifier hs-var">bndr_loc</span></a></span></span><span> </span><span id="local-6989586621681164391"><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681164391"><span class="hs-identifier hs-var">op_name</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-390"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681164391"><span class="hs-identifier hs-var">op_name</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164401"><span class="hs-identifier hs-var">sel_name</span></a></span><span>
</span><span id="line-391"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated
   SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
 SrcSpan, [LSig (GhcPass 'Renamed)])
-&gt; Maybe
     (GenLocated
        SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
      SrcSpan, [LSig (GhcPass 'Renamed)])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
</span><a href="#local-6989586621681164393"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164392"><span class="hs-identifier hs-var">bndr_loc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[LSig (GhcPass 'Renamed)]
</span><a href="#local-6989586621681164394"><span class="hs-identifier hs-var">prags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span>    </span><span class="annot"><a href="#local-6989586621681164395"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span id="local-6989586621681164390"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed))
</span><a href="#local-6989586621681164390"><span class="hs-identifier hs-var">_other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe
  (GenLocated
     SrcSpan (HsBindLR (GhcPass 'Renamed) (GhcPass 'Renamed)),
   SrcSpan, [LSig (GhcPass 'Renamed)])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span class="hs-comment">---------------------------</span><span>
</span><span id="line-395"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#findMinimalDef"><span class="hs-identifier hs-type">findMinimalDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassMinimalDef"><span class="hs-identifier hs-type">ClassMinimalDef</span></a></span><span>
</span><span id="line-396"></span><span id="findMinimalDef"><span class="annot"><span class="annottext">findMinimalDef :: [LSig (GhcPass 'Renamed)] -&gt; Maybe ClassMinimalDef
</span><a href="GHC.Tc.TyCl.Class.html#findMinimalDef"><span class="hs-identifier hs-var hs-var">findMinimalDef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Maybe ClassMinimalDef] -&gt; Maybe ClassMinimalDef
forall a. [Maybe a] -&gt; Maybe a
</span><a href="GHC.Data.Maybe.html#firstJusts"><span class="hs-identifier hs-var">firstJusts</span></a></span><span> </span><span class="annot"><span class="annottext">([Maybe ClassMinimalDef] -&gt; Maybe ClassMinimalDef)
-&gt; ([LSig (GhcPass 'Renamed)] -&gt; [Maybe ClassMinimalDef])
-&gt; [LSig (GhcPass 'Renamed)]
-&gt; Maybe ClassMinimalDef
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(LSig (GhcPass 'Renamed) -&gt; Maybe ClassMinimalDef)
-&gt; [LSig (GhcPass 'Renamed)] -&gt; [Maybe ClassMinimalDef]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LSig (GhcPass 'Renamed) -&gt; Maybe ClassMinimalDef
</span><a href="#local-6989586621681164387"><span class="hs-identifier hs-var">toMinimalDef</span></a></span><span>
</span><span id="line-397"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-398"></span><span>    </span><span class="annot"><a href="#local-6989586621681164387"><span class="hs-identifier hs-type">toMinimalDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassMinimalDef"><span class="hs-identifier hs-type">ClassMinimalDef</span></a></span><span>
</span><span id="line-399"></span><span>    </span><span id="local-6989586621681164387"><span class="annot"><span class="annottext">toMinimalDef :: LSig (GhcPass 'Renamed) -&gt; Maybe ClassMinimalDef
</span><a href="#local-6989586621681164387"><span class="hs-identifier hs-var hs-var">toMinimalDef</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#MinimalSig"><span class="hs-identifier hs-type">MinimalSig</span></a></span><span> </span><span class="annot"><span class="annottext">XMinimalSig (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681164385"><span class="annot"><span class="annottext">BooleanFormula (Located (IdP (GhcPass 'Renamed)))
</span><a href="#local-6989586621681164385"><span class="hs-identifier hs-var">bf</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; Maybe ClassMinimalDef
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Name)
-&gt; BooleanFormula (Located Name) -&gt; ClassMinimalDef
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">BooleanFormula (Located Name)
BooleanFormula (Located (IdP (GhcPass 'Renamed)))
</span><a href="#local-6989586621681164385"><span class="hs-identifier hs-var">bf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>    </span><span class="annot"><a href="#local-6989586621681164387"><span class="hs-identifier hs-var">toMinimalDef</span></a></span><span> </span><span class="annot"><span class="annottext">LSig (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span>                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ClassMinimalDef
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="hs-comment">{-
Note [Polymorphic methods]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
    class Foo a where
        op :: forall b. Ord b =&gt; a -&gt; b -&gt; b -&gt; b
    instance Foo c =&gt; Foo [c] where
        op = e

When typechecking the binding 'op = e', we'll have a meth_id for op
whose type is
      op :: forall c. Foo c =&gt; forall b. Ord b =&gt; [c] -&gt; b -&gt; b -&gt; b

So tcPolyBinds must be capable of dealing with nested polytypes;
and so it is. See GHC.Tc.Gen.Bind.tcMonoBinds (with type-sig case).

Note [Silly default-method bind]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When we pass the default method binding to the type checker, it must
look like    op2 = e
not          $dmop2 = e
otherwise the &quot;$dm&quot; stuff comes out error messages.  But we want the
&quot;$dm&quot; to come out in the interface file.  So we typecheck the former,
and wrap it in a let, thus
          $dmop2 = let op2 = e in op2
This makes the error messages right.


************************************************************************
*                                                                      *
                Error messages
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span id="local-6989586621681164918"><span class="annot"><a href="GHC.Tc.TyCl.Class.html#badMethodErr"><span class="hs-identifier hs-type">badMethodErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681164918"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681164918"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-438"></span><span id="badMethodErr"><span class="annot"><span class="annottext">badMethodErr :: forall a. Outputable a =&gt; a -&gt; Name -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#badMethodErr"><span class="hs-identifier hs-var hs-var">badMethodErr</span></a></span></span><span> </span><span id="local-6989586621681164380"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681164380"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span id="local-6989586621681164379"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164379"><span class="hs-identifier hs-var">op</span></a></span></span><span>
</span><span id="line-439"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Class&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681164380"><span class="hs-identifier hs-var">clas</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-440"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;does not have a method&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164379"><span class="hs-identifier hs-var">op</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span id="local-6989586621681164377"><span class="annot"><a href="GHC.Tc.TyCl.Class.html#badGenericMethod"><span class="hs-identifier hs-type">badGenericMethod</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681164377"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681164377"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-443"></span><span id="badGenericMethod"><span class="annot"><span class="annottext">badGenericMethod :: forall a. Outputable a =&gt; a -&gt; Name -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#badGenericMethod"><span class="hs-identifier hs-var hs-var">badGenericMethod</span></a></span></span><span> </span><span id="local-6989586621681164373"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681164373"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span id="local-6989586621681164372"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164372"><span class="hs-identifier hs-var">op</span></a></span></span><span>
</span><span id="line-444"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Class&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681164373"><span class="hs-identifier hs-var">clas</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-445"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;has a generic-default signature without a binding&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164372"><span class="hs-identifier hs-var">op</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span class="hs-comment">{-
badGenericInstanceType :: LHsBinds Name -&gt; SDoc
badGenericInstanceType binds
  = vcat [text &quot;Illegal type pattern in the generic bindings&quot;,
          nest 2 (ppr binds)]

missingGenericInstances :: [Name] -&gt; SDoc
missingGenericInstances missing
  = text &quot;Missing type patterns for&quot; &lt;+&gt; pprQuotedList missing

dupGenericInsts :: [(TyCon, InstInfo a)] -&gt; SDoc
dupGenericInsts tc_inst_infos
  = vcat [text &quot;More than one type pattern for a single generic type constructor:&quot;,
          nest 2 (vcat (map ppr_inst_ty tc_inst_infos)),
          text &quot;All the type patterns for a generic type constructor must be identical&quot;
    ]
  where
    ppr_inst_ty (_,inst) = ppr (simpleInstInfoTy inst)
-}</span><span>
</span><span id="line-466"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#badDmPrag"><span class="hs-identifier hs-type">badDmPrag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-467"></span><span id="badDmPrag"><span class="annot"><span class="annottext">badDmPrag :: TcId -&gt; Sig (GhcPass 'Renamed) -&gt; TcRn ()
</span><a href="GHC.Tc.TyCl.Class.html#badDmPrag"><span class="hs-identifier hs-var hs-var">badDmPrag</span></a></span></span><span> </span><span id="local-6989586621681164371"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164371"><span class="hs-identifier hs-var">sel_id</span></a></span></span><span> </span><span id="local-6989586621681164370"><span class="annot"><span class="annottext">Sig (GhcPass 'Renamed)
</span><a href="#local-6989586621681164370"><span class="hs-identifier hs-var">prag</span></a></span></span><span>
</span><span id="line-468"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrTc"><span class="hs-identifier hs-var">addErrTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Sig (GhcPass 'Renamed) -&gt; SDoc
forall name. Sig name -&gt; SDoc
</span><a href="GHC.Hs.Binds.html#hsSigDoc"><span class="hs-identifier hs-var">hsSigDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Sig (GhcPass 'Renamed)
</span><a href="#local-6989586621681164370"><span class="hs-identifier hs-var">prag</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;for default method&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164371"><span class="hs-identifier hs-var">sel_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-470"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lacks an accompanying binding&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-471"></span><span>
</span><span id="line-472"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#warningMinimalDefIncomplete"><span class="hs-identifier hs-type">warningMinimalDefIncomplete</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassMinimalDef"><span class="hs-identifier hs-type">ClassMinimalDef</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-473"></span><span id="warningMinimalDefIncomplete"><span class="annot"><span class="annottext">warningMinimalDefIncomplete :: ClassMinimalDef -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#warningMinimalDefIncomplete"><span class="hs-identifier hs-var hs-var">warningMinimalDefIncomplete</span></a></span></span><span> </span><span id="local-6989586621681164365"><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164365"><span class="hs-identifier hs-var">mindef</span></a></span></span><span>
</span><span id="line-474"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The MINIMAL pragma does not require:&quot;</span></span><span>
</span><span id="line-475"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClassMinimalDef -&gt; SDoc
forall a. Outputable a =&gt; BooleanFormula a -&gt; SDoc
</span><a href="GHC.Data.BooleanFormula.html#pprBooleanFormulaNice"><span class="hs-identifier hs-var">pprBooleanFormulaNice</span></a></span><span> </span><span class="annot"><span class="annottext">ClassMinimalDef
</span><a href="#local-6989586621681164365"><span class="hs-identifier hs-var">mindef</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-476"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;but there is no default implementation.&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt1"><span class="hs-identifier hs-type">instDeclCtxt1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigType"><span class="hs-identifier hs-type">LHsSigType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-479"></span><span id="instDeclCtxt1"><span class="annot"><span class="annottext">instDeclCtxt1 :: LHsSigType (GhcPass 'Renamed) -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt1"><span class="hs-identifier hs-var hs-var">instDeclCtxt1</span></a></span></span><span> </span><span id="local-6989586621681164361"><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164361"><span class="hs-identifier hs-var">hs_inst_ty</span></a></span></span><span>
</span><span id="line-480"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#inst_decl_ctxt"><span class="hs-identifier hs-var">inst_decl_ctxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsType (GhcPass 'Renamed) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed) -&gt; LHsType (GhcPass 'Renamed)
forall (p :: Pass). LHsSigType (GhcPass p) -&gt; LHsType (GhcPass p)
</span><a href="GHC.Hs.Type.html#getLHsInstDeclHead"><span class="hs-identifier hs-var">getLHsInstDeclHead</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType (GhcPass 'Renamed)
</span><a href="#local-6989586621681164361"><span class="hs-identifier hs-var">hs_inst_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-481"></span><span>
</span><span id="line-482"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt2"><span class="hs-identifier hs-type">instDeclCtxt2</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-483"></span><span id="instDeclCtxt2"><span class="annot"><span class="annottext">instDeclCtxt2 :: Type -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt2"><span class="hs-identifier hs-var hs-var">instDeclCtxt2</span></a></span></span><span> </span><span id="local-6989586621681164358"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164358"><span class="hs-identifier hs-var">dfun_ty</span></a></span></span><span>
</span><span id="line-484"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Type] -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt3"><span class="hs-identifier hs-var">instDeclCtxt3</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164357"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164356"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-486"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcId]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681164357"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164357"><span class="hs-identifier hs-var">cls</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681164356"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164356"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; ([TcId], [Type], Class, [Type])
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitDFunTy"><span class="hs-identifier hs-var">tcSplitDFunTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164358"><span class="hs-identifier hs-var">dfun_ty</span></a></span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt3"><span class="hs-identifier hs-type">instDeclCtxt3</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-489"></span><span id="instDeclCtxt3"><span class="annot"><span class="annottext">instDeclCtxt3 :: Class -&gt; [Type] -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#instDeclCtxt3"><span class="hs-identifier hs-var hs-var">instDeclCtxt3</span></a></span></span><span> </span><span id="local-6989586621681164354"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164354"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span id="local-6989586621681164353"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164353"><span class="hs-identifier hs-var">cls_tys</span></a></span></span><span>
</span><span id="line-490"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#inst_decl_ctxt"><span class="hs-identifier hs-var">inst_decl_ctxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Class -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681164354"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164353"><span class="hs-identifier hs-var">cls_tys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-491"></span><span>
</span><span id="line-492"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#inst_decl_ctxt"><span class="hs-identifier hs-type">inst_decl_ctxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-493"></span><span id="inst_decl_ctxt"><span class="annot"><span class="annottext">inst_decl_ctxt :: SDoc -&gt; SDoc
</span><a href="GHC.Tc.TyCl.Class.html#inst_decl_ctxt"><span class="hs-identifier hs-var hs-var">inst_decl_ctxt</span></a></span></span><span> </span><span id="local-6989586621681164352"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681164352"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the instance declaration for&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span>                        </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681164352"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-495"></span><span>
</span><span id="line-496"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#tcATDefault"><span class="hs-identifier hs-type">tcATDefault</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-497"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span>
</span><span id="line-498"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#NameSet"><span class="hs-identifier hs-type">NameSet</span></a></span><span>
</span><span id="line-499"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#ClassATItem"><span class="hs-identifier hs-type">ClassATItem</span></a></span><span>
</span><span id="line-500"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier hs-type">FamInst</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-501"></span><span class="hs-comment">-- ^ Construct default instances for any associated types that</span><span>
</span><span id="line-502"></span><span class="hs-comment">-- aren't given a user definition</span><span>
</span><span id="line-503"></span><span class="hs-comment">-- Returns [] or singleton</span><span>
</span><span id="line-504"></span><span id="tcATDefault"><span class="annot"><span class="annottext">tcATDefault :: SrcSpan -&gt; TCvSubst -&gt; NameSet -&gt; ClassATItem -&gt; TcM [FamInst]
</span><a href="GHC.Tc.TyCl.Class.html#tcATDefault"><span class="hs-identifier hs-var hs-var">tcATDefault</span></a></span></span><span> </span><span id="local-6989586621681164350"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164350"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681164349"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164349"><span class="hs-identifier hs-var">inst_subst</span></a></span></span><span> </span><span id="local-6989586621681164348"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681164348"><span class="hs-identifier hs-var">defined_ats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Class.html#ATI"><span class="hs-identifier hs-type">ATI</span></a></span><span> </span><span id="local-6989586621681164346"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span></span><span> </span><span id="local-6989586621681164345"><span class="annot"><span class="annottext">Maybe (Type, ATValidityInfo)
</span><a href="#local-6989586621681164345"><span class="hs-identifier hs-var">defs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-505"></span><span>  </span><span class="hs-comment">-- User supplied instances ==&gt; everything is OK</span><span>
</span><span id="line-506"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681164348"><span class="hs-identifier hs-var">defined_ats</span></a></span><span>
</span><span id="line-507"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FamInst] -&gt; TcM [FamInst]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-508"></span><span>
</span><span id="line-509"></span><span>  </span><span class="hs-comment">-- No user instance, have defaults ==&gt; instantiate them</span><span>
</span><span id="line-510"></span><span>   </span><span class="hs-comment">-- Example:   class C a where { type F a b :: *; type F a b = () }</span><span>
</span><span id="line-511"></span><span>   </span><span class="hs-comment">--            instance C [x]</span><span>
</span><span id="line-512"></span><span>   </span><span class="hs-comment">-- Then we want to generate the decl:   type F [x] b = ()</span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164343"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164343"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164342"><span class="annot"><span class="annottext">ATValidityInfo
</span><a href="#local-6989586621681164342"><span class="hs-identifier hs-var">_loc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (Type, ATValidityInfo)
</span><a href="#local-6989586621681164345"><span class="hs-identifier hs-var">defs</span></a></span><span>
</span><span id="line-514"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681164341"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164341"><span class="hs-identifier hs-var">subst'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164340"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164340"><span class="hs-identifier hs-var">pat_tys'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TCvSubst -&gt; TcId -&gt; (TCvSubst, Type))
-&gt; TCvSubst -&gt; [TcId] -&gt; (TCvSubst, [Type])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; TcId -&gt; (TCvSubst, Type)
</span><a href="#local-6989586621681164339"><span class="hs-identifier hs-var">subst_tv</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164349"><span class="hs-identifier hs-var">inst_subst</span></a></span><span>
</span><span id="line-515"></span><span>                                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [TcId]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var hs-var">tyConTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-516"></span><span>             </span><span id="local-6989586621681164337"><span class="annot"><span class="annottext">rhs' :: Type
</span><a href="#local-6989586621681164337"><span class="hs-identifier hs-var hs-var">rhs'</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Subst.html#substTyUnchecked"><span class="hs-identifier hs-var">substTyUnchecked</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164341"><span class="hs-identifier hs-var">subst'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164343"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-517"></span><span>             </span><span id="local-6989586621681164335"><span class="annot"><span class="annottext">tcv' :: [TcId]
</span><a href="#local-6989586621681164335"><span class="hs-identifier hs-var hs-var">tcv'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; [TcId]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesList"><span class="hs-identifier hs-var">tyCoVarsOfTypesList</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164340"><span class="hs-identifier hs-var">pat_tys'</span></a></span><span>
</span><span id="line-518"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681164333"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164333"><span class="hs-identifier hs-var">tv'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681164332"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164332"><span class="hs-identifier hs-var">cv'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcId -&gt; Bool) -&gt; [TcId] -&gt; ([TcId], [TcId])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164335"><span class="hs-identifier hs-var">tcv'</span></a></span><span>
</span><span id="line-519"></span><span>             </span><span id="local-6989586621681164330"><span class="annot"><span class="annottext">tvs' :: [TcId]
</span><a href="#local-6989586621681164330"><span class="hs-identifier hs-var hs-var">tvs'</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; [TcId]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var">scopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164333"><span class="hs-identifier hs-var">tv'</span></a></span><span>
</span><span id="line-520"></span><span>             </span><span id="local-6989586621681164328"><span class="annot"><span class="annottext">cvs' :: [TcId]
</span><a href="#local-6989586621681164328"><span class="hs-identifier hs-var hs-var">cvs'</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; [TcId]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var">scopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164332"><span class="hs-identifier hs-var">cv'</span></a></span><span>
</span><span id="line-521"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164327"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164327"><span class="hs-identifier hs-var">rep_tc_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; [Type] -&gt; TcM Name
</span><a href="GHC.Tc.Utils.Env.html#newFamInstTyConName"><span class="hs-identifier hs-var">newFamInstTyConName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681164350"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164340"><span class="hs-identifier hs-var">pat_tys'</span></a></span><span>
</span><span id="line-522"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681164325"><span class="annot"><span class="annottext">axiom :: CoAxiom Unbranched
</span><a href="#local-6989586621681164325"><span class="hs-identifier hs-var hs-var">axiom</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Role
-&gt; Name
-&gt; [TcId]
-&gt; [TcId]
-&gt; [TcId]
-&gt; TyCon
-&gt; [Type]
-&gt; Type
-&gt; CoAxiom Unbranched
</span><a href="GHC.Core.FamInstEnv.html#mkSingleCoAxiom"><span class="hs-identifier hs-var">mkSingleCoAxiom</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164327"><span class="hs-identifier hs-var">rep_tc_name</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164330"><span class="hs-identifier hs-var">tvs'</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681164328"><span class="hs-identifier hs-var">cvs'</span></a></span><span>
</span><span id="line-523"></span><span>                                     </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681164340"><span class="hs-identifier hs-var">pat_tys'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164337"><span class="hs-identifier hs-var">rhs'</span></a></span><span>
</span><span id="line-524"></span><span>           </span><span class="hs-comment">-- NB: no validity check. We check validity of default instances</span><span>
</span><span id="line-525"></span><span>           </span><span class="hs-comment">-- in the class definition. Because type instance arguments cannot</span><span>
</span><span id="line-526"></span><span>           </span><span class="hs-comment">-- be type family applications and cannot be polytypes, the</span><span>
</span><span id="line-527"></span><span>           </span><span class="hs-comment">-- validity check is redundant.</span><span>
</span><span id="line-528"></span><span>
</span><span id="line-529"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mk_deflt_at_instance&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164343"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-530"></span><span>                                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched -&gt; SDoc
forall (br :: BranchFlag). CoAxiom br -&gt; SDoc
</span><a href="GHC.Core.Coercion.html#pprCoAxiom"><span class="hs-identifier hs-var">pprCoAxiom</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621681164325"><span class="hs-identifier hs-var">axiom</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-531"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164322"><span class="annot"><span class="annottext">FamInst
</span><a href="#local-6989586621681164322"><span class="hs-identifier hs-var">fam_inst</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FamFlavor -&gt; CoAxiom Unbranched -&gt; TcM FamInst
</span><a href="GHC.Tc.Instance.Family.html#newFamInst"><span class="hs-identifier hs-var">newFamInst</span></a></span><span> </span><span class="annot"><span class="annottext">FamFlavor
</span><a href="GHC.Core.FamInstEnv.html#SynFamilyInst"><span class="hs-identifier hs-var">SynFamilyInst</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621681164325"><span class="hs-identifier hs-var">axiom</span></a></span><span>
</span><span id="line-532"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[FamInst] -&gt; TcM [FamInst]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FamInst
</span><a href="#local-6989586621681164322"><span class="hs-identifier hs-var">fam_inst</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-533"></span><span>
</span><span id="line-534"></span><span>   </span><span class="hs-comment">-- No defaults ==&gt; generate a warning</span><span>
</span><span id="line-535"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-comment">-- defs = Nothing</span><span>
</span><span id="line-536"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcRn ()
</span><a href="GHC.Tc.TyCl.Class.html#warnMissingAT"><span class="hs-identifier hs-var">warnMissingAT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681164346"><span class="hs-identifier hs-var">fam_tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-537"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[FamInst] -&gt; TcM [FamInst]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-538"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-539"></span><span>    </span><span id="local-6989586621681164339"><span class="annot"><span class="annottext">subst_tv :: TCvSubst -&gt; TcId -&gt; (TCvSubst, Type)
</span><a href="#local-6989586621681164339"><span class="hs-identifier hs-var hs-var">subst_tv</span></a></span></span><span> </span><span id="local-6989586621681164318"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164318"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span id="local-6989586621681164317"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164317"><span class="hs-identifier hs-var">tc_tv</span></a></span></span><span>
</span><span id="line-540"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681164316"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164316"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">VarEnv Type -&gt; TcId -&gt; Maybe Type
forall a. VarEnv a -&gt; TcId -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst -&gt; VarEnv Type
</span><a href="GHC.Core.TyCo.Subst.html#getTvSubstEnv"><span class="hs-identifier hs-var">getTvSubstEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164318"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164317"><span class="hs-identifier hs-var">tc_tv</span></a></span><span>
</span><span id="line-541"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164318"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164316"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-542"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-543"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst -&gt; TcId -&gt; Type -&gt; TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#extendTvSubst"><span class="hs-identifier hs-var">extendTvSubst</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164318"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164317"><span class="hs-identifier hs-var">tc_tv</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164312"><span class="hs-identifier hs-var">ty'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681164312"><span class="hs-identifier hs-var">ty'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-544"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-545"></span><span>        </span><span id="local-6989586621681164312"><span class="annot"><span class="annottext">ty' :: Type
</span><a href="#local-6989586621681164312"><span class="hs-identifier hs-var hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; TcId -&gt; TcId
</span><a href="GHC.Types.Var.html#updateTyVarKind"><span class="hs-identifier hs-var">updateTyVarKind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Subst.html#substTyUnchecked"><span class="hs-identifier hs-var">substTyUnchecked</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681164318"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681164317"><span class="hs-identifier hs-var">tc_tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span class="annot"><a href="GHC.Tc.TyCl.Class.html#warnMissingAT"><span class="hs-identifier hs-type">warnMissingAT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-548"></span><span id="warnMissingAT"><span class="annot"><span class="annottext">warnMissingAT :: Name -&gt; TcRn ()
</span><a href="GHC.Tc.TyCl.Class.html#warnMissingAT"><span class="hs-identifier hs-var hs-var">warnMissingAT</span></a></span></span><span> </span><span id="local-6989586621681164309"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164309"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-549"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681164308"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681164308"><span class="hs-identifier hs-var">warn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. WarningFlag -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#woptM"><span class="hs-identifier hs-var">woptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnMissingMethods"><span class="hs-identifier hs-var">Opt_WarnMissingMethods</span></a></span><span>
</span><span id="line-550"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;warn&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164309"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681164308"><span class="hs-identifier hs-var">warn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-551"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681164305"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681164305"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TcGblEnv -&gt; HscSource)
-&gt; TcRnIf TcGblEnv TcLclEnv TcGblEnv
-&gt; IOEnv (Env TcGblEnv TcLclEnv) HscSource
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; HscSource
</span><a href="GHC.Tc.Types.html#tcg_src"><span class="hs-identifier hs-var hs-var">tcg_src</span></a></span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-552"></span><span>       </span><span class="hs-comment">-- Warn only if -Wmissing-methods AND not a signature</span><span>
</span><span id="line-553"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnTc"><span class="hs-identifier hs-var">warnTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnMissingMethods"><span class="hs-identifier hs-var">Opt_WarnMissingMethods</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681164308"><span class="hs-identifier hs-var">warn</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681164305"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-554"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No explicit&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;associated type&quot;</span></span><span>
</span><span id="line-555"></span><span>                    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;or default declaration for&quot;</span></span><span>
</span><span id="line-556"></span><span>                    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681164309"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-557"></span></pre></body></html>